package swt_1;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.custom.StackLayout;
import swing2swt.layout.BorderLayout;

public class LayoutWin2 {

	protected Shell shell;
	private Label lblNewLabel;
	private Text txtWest;
	private Label lblSouth;
	private Label lblEast;
	private Text txtCenter;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			LayoutWin2 window = new LayoutWin2();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(807, 627);
		shell.setText("SWT Application");
		shell.setLayout(new BorderLayout(0, 0));
		
		lblNewLabel = new Label(shell, SWT.NONE);
		lblNewLabel.setLayoutData(BorderLayout.NORTH);
		lblNewLabel.setText("New Label");
		
		txtWest = new Text(shell, SWT.BORDER);
		txtWest.setText("west");
		txtWest.setLayoutData(BorderLayout.WEST);
		
		lblSouth = new Label(shell, SWT.NONE);
		lblSouth.setLayoutData(BorderLayout.SOUTH);
		lblSouth.setText("south");
		
		lblEast = new Label(shell, SWT.NONE);
		lblEast.setLayoutData(BorderLayout.EAST);
		lblEast.setText("east");
		
		txtCenter = new Text(shell, SWT.BORDER);
		txtCenter.setText("center");
		txtCenter.setLayoutData(BorderLayout.CENTER);

	}
}
